Optimal. Leaf size=90 \[ \frac{2 a^3 \tan (c+d x)}{d}+\frac{4 i a^3 \log (\cos (c+d x))}{d}-4 a^3 x-\frac{i (a+i a \tan (c+d x))^4}{4 a d}-\frac{i a (a+i a \tan (c+d x))^2}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0698095, antiderivative size = 90, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3543, 3478, 3477, 3475} \[ \frac{2 a^3 \tan (c+d x)}{d}+\frac{4 i a^3 \log (\cos (c+d x))}{d}-4 a^3 x-\frac{i (a+i a \tan (c+d x))^4}{4 a d}-\frac{i a (a+i a \tan (c+d x))^2}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3543
Rule 3478
Rule 3477
Rule 3475
Rubi steps
\begin{align*} \int \tan ^2(c+d x) (a+i a \tan (c+d x))^3 \, dx &=-\frac{i (a+i a \tan (c+d x))^4}{4 a d}-\int (a+i a \tan (c+d x))^3 \, dx\\ &=-\frac{i a (a+i a \tan (c+d x))^2}{2 d}-\frac{i (a+i a \tan (c+d x))^4}{4 a d}-(2 a) \int (a+i a \tan (c+d x))^2 \, dx\\ &=-4 a^3 x+\frac{2 a^3 \tan (c+d x)}{d}-\frac{i a (a+i a \tan (c+d x))^2}{2 d}-\frac{i (a+i a \tan (c+d x))^4}{4 a d}-\left (4 i a^3\right ) \int \tan (c+d x) \, dx\\ &=-4 a^3 x+\frac{4 i a^3 \log (\cos (c+d x))}{d}+\frac{2 a^3 \tan (c+d x)}{d}-\frac{i a (a+i a \tan (c+d x))^2}{2 d}-\frac{i (a+i a \tan (c+d x))^4}{4 a d}\\ \end{align*}
Mathematica [B] time = 1.5869, size = 228, normalized size = 2.53 \[ -\frac{a^3 \sec (c) \sec ^4(c+d x) \left (-13 \sin (c+2 d x)+7 \sin (3 c+2 d x)-5 \sin (3 c+4 d x)+8 d x \cos (3 c+2 d x)-5 i \cos (3 c+2 d x)+2 d x \cos (3 c+4 d x)+2 d x \cos (5 c+4 d x)-4 i \cos (3 c+2 d x) \log \left (\cos ^2(c+d x)\right )+2 \cos (c) \left (-3 i \log \left (\cos ^2(c+d x)\right )+6 d x-4 i\right )+\cos (c+2 d x) \left (-4 i \log \left (\cos ^2(c+d x)\right )+8 d x-5 i\right )-i \cos (3 c+4 d x) \log \left (\cos ^2(c+d x)\right )-i \cos (5 c+4 d x) \log \left (\cos ^2(c+d x)\right )+15 \sin (c)\right )}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.004, size = 101, normalized size = 1.1 \begin{align*} 4\,{\frac{{a}^{3}\tan \left ( dx+c \right ) }{d}}-{\frac{{\frac{i}{4}}{a}^{3} \left ( \tan \left ( dx+c \right ) \right ) ^{4}}{d}}-{\frac{{a}^{3} \left ( \tan \left ( dx+c \right ) \right ) ^{3}}{d}}+{\frac{2\,i{a}^{3} \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{d}}-{\frac{2\,i{a}^{3}\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) }{d}}-4\,{\frac{{a}^{3}\arctan \left ( \tan \left ( dx+c \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 2.41642, size = 111, normalized size = 1.23 \begin{align*} -\frac{i \, a^{3} \tan \left (d x + c\right )^{4} + 4 \, a^{3} \tan \left (d x + c\right )^{3} - 8 i \, a^{3} \tan \left (d x + c\right )^{2} + 16 \,{\left (d x + c\right )} a^{3} + 8 i \, a^{3} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 16 \, a^{3} \tan \left (d x + c\right )}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.22138, size = 506, normalized size = 5.62 \begin{align*} \frac{24 i \, a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 46 i \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 36 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 10 i \, a^{3} +{\left (4 i \, a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} + 16 i \, a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 24 i \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 16 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 4 i \, a^{3}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 7.05857, size = 180, normalized size = 2. \begin{align*} \frac{4 i a^{3} \log{\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac{\frac{24 i a^{3} e^{- 2 i c} e^{6 i d x}}{d} + \frac{46 i a^{3} e^{- 4 i c} e^{4 i d x}}{d} + \frac{36 i a^{3} e^{- 6 i c} e^{2 i d x}}{d} + \frac{10 i a^{3} e^{- 8 i c}}{d}}{e^{8 i d x} + 4 e^{- 2 i c} e^{6 i d x} + 6 e^{- 4 i c} e^{4 i d x} + 4 e^{- 6 i c} e^{2 i d x} + e^{- 8 i c}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.6925, size = 298, normalized size = 3.31 \begin{align*} \frac{4 i \, a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 16 i \, a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 24 i \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 16 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 24 i \, a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 46 i \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 36 i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 4 i \, a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 10 i \, a^{3}}{d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]